package com.isoft.repository;

import com.isoft.entity.Authority;
import com.isoft.entity.Customer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author LiuGaoMing
 * @version 1.0
 * @description:
 * @date 2024/5/17 8:56
 */
public interface CustomerRepository extends JpaRepository<Customer,Integer> {

    @Query(value = "select c.* from t_authority a,t_customer c,t_customer_authority ca where a.id=ca.authority_id and c.id=ca.customer_id and c.username=?1"
        ,nativeQuery = true)
    Customer findByUsername(String username);
}
